package com.cloud.applet.controller;

import com.alibaba.fastjson.JSONObject;
import com.cloud.applet.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class LoginController {

    @Autowired
    private UserService service;


    @RequestMapping("/login")
    public JSONObject getApprovedListByOwner(@RequestBody String owner){
        JSONObject jsonObject = JSONObject.parseObject(owner);
        JSONObject object = service.login(jsonObject);
        return object;
    }

    @RequestMapping("/addAddress")
    public JSONObject addAddress(@RequestBody String owner){
        JSONObject jsonObject = JSONObject.parseObject(owner);
        JSONObject object = service.addAddress(jsonObject);
        return object;
    }


}
